package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.CapBillMapper;
import com.aidex.biz.domain.CapBill;
import com.aidex.biz.service.CapBillService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 资方结算Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-12-17
 */
@Service
@Transactional(readOnly = true)
public class CapBillServiceImpl extends BaseServiceImpl<CapBillMapper, CapBill> implements CapBillService
{
    private static final Logger log = LoggerFactory.getLogger(CapBillServiceImpl.class);

    /**
     * 获取单条数据
     * @param capBill 资方结算
     * @return 资方结算
     */
    @Override
    public CapBill get(CapBill capBill)
    {
        CapBill dto = super.get(capBill);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 资方结算id
     * @return 资方结算
     */
    @Override
    public CapBill get(String id)
    {
        CapBill dto = super.get(id);
        return dto;
    }


    /**
     * 查询资方结算列表
     * @param capBill 资方结算
     * @return 资方结算
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<CapBill> findList(CapBill capBill)
    {
        return super.findList(capBill);
    }

    /**
     * 分页查询资方结算列表
     * @param capBill 资方结算
     * @return 资方结算
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<CapBill> findPage(CapBill capBill)
    {
        return super.findPage(capBill);
    }

    /**
     * 保存资方结算
     * @param capBill
     * @return 结果
     */
    @Override
    public boolean save(CapBill capBill)
    {
        return super.save(capBill);
    }


    /**
     * 删除资方结算信息
     * @param capBill
     * @return 结果
     */
    @Override
    public boolean remove(CapBill capBill)
    {
        return super.remove(capBill);
    }

    /**
     * 批量删除资方结算
     * @param ids 需要删除的资方结算ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteCapBillByIds(String[] ids)
    {
        return mapper.deleteCapBillByIds(ids);
    }

    /**
     * 获取最大编号
     * @param capBill 资方结算
     * @return 结果
     */
    @Override
    public int findMaxSort(CapBill capBill)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(capBill));
    }
}
